Skip to content

[None][perf] Allow CUDA-core NVFP4 GEMM for M up to 16#16345

Open
mihai-chiorean wants to merge 4 commits into
NVIDIA:mainfrom
mihai-chiorean:codex/cudacore-nvfp4-m16
Open

[None][perf] Allow CUDA-core NVFP4 GEMM for M up to 16#16345
mihai-chiorean wants to merge 4 commits into
NVIDIA:mainfrom
mihai-chiorean:codex/cudacore-nvfp4-m16

Conversation

@mihai-chiorean

@mihai-chiorean mihai-chiorean commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Increase CUDA-core NVFP4 GEMM autotuner eligibility from M <= 8 to M <= 16, matching the C++ cudaCoreGemmTemplateMaxM limit.
  • Update CUDA-core NVFP4 docs/errors and unit coverage for the M=16 case.
  • This does not force CUDA-core selection: CUTLASS/cuBLASLt remain available for larger shapes, and cuda_core-only configurations still fail fast when a shape exceeds CUDA-core support.

Performance

Spark SM121, Qwen3.6 35B A3B NVFP4, no-MTP graph+overlap smoke (with my other patches to get Qwen3.6 35B A3B NVFP4 to run):

  • Baseline: 37.270 ms TPOT / 26.831 tok/s
  • M<=16 temp patch: 33.501 ms TPOT / 29.850 tok/s
  • Repeat M<=16 temp patch: 33.565 ms TPOT / 29.793 tok/s

Testing

  • uvx pre-commit run --files tensorrt_llm/_torch/custom_ops/torch_custom_ops.py tests/unittest/_torch/thop/parallel/test_fp4_linear.py
  • Spark SM121: pytest -q tests/unittest/_torch/thop/parallel/test_fp4_linear.py -k test_fp4_linear_cuda_core via TensorRT bindings bootstrap: 4 passed
  • Spark SM121: pytest -q tests/unittest/_torch/thop/parallel/test_fp4_linear.py -k "test_fp4_gemm_bias_per_backend and cuda_core" via TensorRT bindings bootstrap: 1 passed, 3 skipped

Summary by CodeRabbit

  • New Features

    • Expanded CUDA Core NVFP4 GEMM support for small-batch workloads with matrix dimension M up to 16.
  • Bug Fixes

    • Updated FP4 GEMM validation to correctly allow supported M=16 workloads and bias parity checks.

Signed-off-by: Mihai Chiorean <mihai.v.chiorean@gmail.com>
@mihai-chiorean
mihai-chiorean requested a review from a team as a code owner July 13, 2026 23:30
@mihai-chiorean
mihai-chiorean requested a review from hyukn July 13, 2026 23:30
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

CUDA Core NVFP4 GEMM eligibility is expanded from M ≤ 8 to M ≤ 16. Runtime documentation, the shape limit, and FP4 linear tests are updated to cover the larger dimension.

Changes

NVFP4 CUDA Core eligibility

Layer / File(s) Summary
Expand CUDA Core limit and validation
tensorrt_llm/_torch/custom_ops/torch_custom_ops.py, tests/unittest/_torch/thop/parallel/test_fp4_linear.py
The CUDA Core limit and GEMM documentation now specify M <= 16; tests add M=16 coverage and relax the bias parity skip threshold.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: hyukn, bo-nv, xuantengh, pengbowang-nv, nv-guomingz

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise, properly formatted, and accurately summarizes the main change to CUDA-core NVFP4 GEMM eligibility.
Description check ✅ Passed The description includes summary, performance, and testing details and is mostly complete despite omitting the PR checklist confirmation.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

yizhang-nv
yizhang-nv previously approved these changes Jul 15, 2026
@yizhang-nv
yizhang-nv dismissed their stale review July 15, 2026 03:39

Withdrawing my approval.

@mihai-chiorean

Copy link
Copy Markdown
Contributor Author

@yizhang-nv what happened? why dismiss? any feedback?

@mihai-chiorean
mihai-chiorean requested review from a team as code owners July 15, 2026 04:40
@mikeiovine
mikeiovine requested review from mikeiovine and removed request for schetlur-nv July 20, 2026 15:30
@mihai-chiorean

Copy link
Copy Markdown
Contributor Author

@mikeiovine thanks for the stamp! any chance you could trigger CI too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants